import '../../node_modules/vue@2.6.10/vue.min.js'
import '../../node_modules/axios@1.6.5/axios.min.js'

const mcServerURL = 'mc.fmboy.cn:60001'

new Vue({
  el: '#app',
  data: {
    mcServerStatus: false // MC服务器状态
  },
  created() {
    axios(`https://api.mcstatus.io/v2/status/bedrock/${mcServerURL}`).then(res => { this.mcServerStatus = res.data.online })
    setInterval(() => { axios(`https://api.mcstatus.io/v2/status/bedrock/${mcServerURL}`).then(res => { this.mcServerStatus = res.data.online }) }, 10000)

  },
  methods: {
    to(url) { window.location.href = url }
  }
})